/*-----------------------------------------------------------*/
/*copyright by 动力无限  www.btoe.cn*/
/*邮箱 btoe@btoe.cn*/
/*合作电话 400-0599-360*/
/*版权所有违者必究*/
/*-----------------------------------------------------------*/
var newsPageProductPage1CaseBoxList = new Swiper('.newsPageProductPage1CaseBoxList .swiper-container', {
	speed: 500,
	spaceBetween: 20,
	parallax: true,
});
$('.newsPageProductPage1Case .newsPageProductPage1CaseBox .hd ul li').mousemove(function () {
	//按钮
	var index = $(this).index();
	$('.newsPageProductPage1Case .newsPageProductPage1CaseBox .hd ul li').removeClass('on');
	$(this).addClass('on');
	//on 为需要替换的新样式
	$('.newsPageProductPage1Case .newsPageProductPage1CaseBox .bd .swiper-slide').eq(index).show().siblings('.newsPageProductPage1Case .newsPageProductPage1CaseBox .bd .swiper-slide').hide();
	//选项卡大盒子
})
$('.newsPageProductPage1Case .newsPageProductPage1CaseBox .hd ul li').eq(0).trigger('mousemove');
$('#page').css('min-height', window.outerHeight);
$(".newsPageProductPage1MessageBoxBth").click(function () {
	var content = $('.newsPageProductPage1MessageBoxCenter').val();
	var userName = $('.newsPageProductPage1MessageBoxName').val();
	var userPhone = $('.newsPageProductPage1MessageBoxTel').val();
	var kcode = $('.newsPageProductPage1MessageBoxCode').val();
	// var kemail = $('.useremail').val();
	var reg = /^1[3|4|5|6|7|8|9]\d{9}$/;
	if (userName == "") {
		alert('姓名不能为空！')
		$(".newsPageProductPage1MessageBoxName").focus();
		return false;
	}
	if (userPhone == "") {
		alert('号码不能为空！')
		$(".newsPageProductPage1MessageBoxTel").focus();
		return false;
	}
	if (!reg.test(userPhone)) {
		alert('号码填写有误！')
		$(".newsPageProductPage1MessageBoxTel").focus();
		return false;
	}
	if (content == "" || content.length < 10) {
		alert('留言内容必须大于10字！')
		$(".newsPageProductPage1MessageBoxCenter").focus();
		return false;
	}

	if (kcode == "") {
		alert('验证码不能为空,请点击验证码后输入验证码')
		$(".newsPageProductPage1MessageBoxCode").focus();
		return false;
	}
	$.post('/api/message.ashx?action=add', {
		"kcontent": '信息：' + content,
		"kuser": userName,
		"kphone": userPhone,
		"kcode": kcode
	}, function (res) {
		if (res == '1') {
			alert("留言提交成功");
			$('.newsPageProductPage1MessageBoxCenter').val('');
			$('.newsPageProductPage1MessageBoxName').val('');
			$('.newsPageProductPage1MessageBoxTel').val('');
			$('.newsPageProductPage1MessageBoxCode').val('');
		} else {
			alert('留言提交失败')
		}
	})
})
$('.newsPageProductPage1Message .newsPageProductPage1MessageBox ul li i.newsPageProductPage1MessageBoxA').click(function () {
	$(this).hide();
	$(this).parent().find('img').css({
		transform: 'translateY(-70px)',
	})
	return
})
$(".newsPageProductPage1MessageBoxCodeText").click(function () {
	$(this)[0].src = '/api/message.ashx?action=code&' + Math.random();
})

$(".newsPageProductPage1MessageBoxCode").blur(function () {
	$('.newsPageProductPage1Message .newsPageProductPage1MessageBox ul li i.newsPageProductPage1MessageBoxA').show();
	$('.newsPageProductPage1MessageBoxCodeText').css({
		transform: 'translateY(0px)',
	})
})
var aboutHonorNewCenter = new Swiper('.aboutHonorNewCenter .swiper-container', {
	loop: true,
	autoplay: 5000,
	prevButton: '.aboutHonorNewImgL',
	nextButton: '.aboutHonorNewImgR',
	spaceBetween: 30
});
var newsPageProductPageNewCenter1RXgnrList = new Swiper('.newsPageProductPageNewCenter1RXgnrList .swiper-container', {
	nextButton: '.newsPageProductPageNewCenter1RXgnrListR',
	prevButton: '.newsPageProductPageNewCenter1RXgnrListL',
	spaceBetween: 30,
	autoplay: 5000,
	loop: true,
});
$(".aboutNewBox2BoxMessageBth").click(function () {
	var content = $('.aboutNewBox2BoxMessage3').val();
	var userName = $('.aboutNewBox2BoxMessage1').val();
	var userPhone = $('.aboutNewBox2BoxMessage2').val();
	var kcode = $('.aboutNewBox2BoxMessage4').val();
	// var kemail = $('.useremail').val();
	var reg = /^1[3|4|5|6|7|8|9]\d{9}$/;
	if (userName == "") {
		alert('姓名不能为空！')
		$(".aboutNewBox2BoxMessage1").focus();
		return false;
	}
	if (userPhone == "") {
		alert('号码不能为空！')
		$(".aboutNewBox2BoxMessage2").focus();
		return false;
	}
	if (!reg.test(userPhone)) {
		alert('号码填写有误！')
		$(".aboutNewBox2BoxMessage2").focus();
		return false;
	}
	if (content == "" || content.length < 10) {
		alert('留言内容必须大于10字！')
		$(".aboutNewBox2BoxMessage3").focus();
		return false;
	}

	if (kcode == "") {
		alert('验证码不能为空,请点击验证码后输入验证码')
		$(".aboutNewBox2BoxMessage4").focus();
		return false;
	}
	$.post('/api/message.ashx?action=add', {
		"kcontent": '信息：' + content,
		"kuser": userName,
		"kphone": userPhone,
		"kcode": kcode
	}, function (res) {
		if (res == '1') {
			alert("留言提交成功");
			$('.aboutNewBox2BoxMessage3').val('');
			$('.aboutNewBox2BoxMessage1').val('');
			$('.aboutNewBox2BoxMessage2').val('');
			$('.aboutNewBox2BoxMessage4').val('');
		} else {
			alert('留言提交失败')
		}
	})
})

$(".contactImgcode").click(function () {
	$(this)[0].src = '/api/message.ashx?action=code&' + Math.random();
})
// for(b = 0 ; b <$('.newsPageProductPage1 .newsPageProductPage1Hd ul li .newsPageProductPage1HdBottom').length; b++){
// 	console.log($(this).eq(b).find('a').length);
// }
var allpid = [];
for (i = 0; i < $('.newsPageProductPage1 .newsPageProductPage1Hd ul li').length; i++) {

	if ($('.newsPageProductPage1 .newsPageProductPage1Hd ul li').eq(i).find('.newsPageProductPage1HdBottom a').length == 0) {
		$('.newsPageProductPage1 .newsPageProductPage1Hd ul li').eq(i).find('.newsPageProductPage1HdBottom').height(0);
	}


	if ($('.newsPageProductPage1 .newsPageProductPage1Hd ul li').eq(i).find('.newsPageProductPage1HdBottom a').length == 1) {
		$('.newsPageProductPage1 .newsPageProductPage1Hd ul li').eq(i).find('.newsPageProductPage1HdBottom').height(30);
	}

	if ($('.newsPageProductPage1 .newsPageProductPage1Hd ul li').eq(i).find('.newsPageProductPage1HdBottom a').length >= 2) {

		$('.newsPageProductPage1 .newsPageProductPage1Hd ul li').eq(i).find('.newsPageProductPage1HdBottom').height(60);
	}

}
$(function () {
    $('#page').removeClass("goout");
});
$(function () { 
    var flag = 1;
    $('.lcbody').click(function () {
        if (flag === 1) {
            $('body').addClass('open');
            $('#leftnav').show();
            flag = 0
        } else if (flag === 0) {
            $('body').removeClass('open');
            $('#leftnav').hide();
            flag = 1
        }
    })
    $('#main').click(function () {
        if (flag == 0) {
            $('body').removeClass('open');
            var t = setTimeout("$('#leftnav').hide()", 400)
            flag = 1;
        }

    })
});
$(function () {
    $('.goback').click(function () {
        if (window.history.length > 1) {
            window.history.go(-1)
        } else {
            window.location.href = '/'
        }
    })
});

  
$('#leftnav ul li .navOne').on('click',function(){
      $(this).toggleClass('navOne1')
      $(this).next('ul').slideToggle();
  })